package com.qdxwx.data.service.operLog;

import com.qdxwx.common.page.PageRequest;
import com.qdxwx.common.utils.TKConvert;
import com.qdxwx.data.mapper.operLog.OperLogMapper;
import com.qdxwx.models.operLog.OperLog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 操作日志 服务层处理
 * Qdx NetSchool Platform
 * @author qdxwx
 * @updateTime 2022/5/25
 * @description
 */
@Service
public class OperLogServiceImpl implements OperLogService
{
    @Autowired
    private OperLogMapper operLogMapper;

    @Override
    public void insert(OperLog operLog)
    {
        operLogMapper.insertOperlog(operLog);
    }

    @Override
    public List<OperLog> getList(OperLog operLog, PageRequest page)
    {
        return operLogMapper.selectList(operLog,page);
    }

    @Override
    public long count(OperLog operLog)
    {
        return operLogMapper.selectCount(operLog);
    }

    @Override
    public int deleteByIds(String ids)
    {
        return operLogMapper.deleteOperLogByIds(TKConvert.toStrArray(ids));
    }

    @Override
    public OperLog get(Long operId)
    {
        return operLogMapper.selectOperLogById(operId);
    }

    @Override
    public void clean()
    {
        operLogMapper.cleanOperLog();
    }
}
